<?php

/*

Send Mail (mail_send.php)

*/

$page_title = "Send Mail";
$rank_check = 3;
include "header.inc.php";

print "$openHTML";

if ($type == "reply")
{
	$findMail = fetch("SELECT * FROM mail_topics2 WHERE to_user = '$userid' AND id = '$id' AND game = '$game'");
	$findMail2 = fetch("SELECT * FROM mail_messages2 WHERE mail_id = '$findMail[id]' AND game = '$game'");
	$findSender = fetch("SELECT username FROM members2 WHERE id = 	'$findMail[from_user]' AND game = '$game'");

	$send_to = $findSender[username];
	$subject = "Re: ". eregi_replace("Re: ", "", $findMail[subject]);
	$showmessage = unformat(unsmilies(strip_tags("$findMail2[message]", "<b><i><u>")));
}

if ($type == "forward")
{
	$findMail = fetch("SELECT * FROM mail_topics2 WHERE to_user = '$userid' AND id = '$id' AND game = '$game'");
	$findMail2 = fetch("SELECT * FROM mail_messages2 WHERE mail_id = '$findMail[id]' AND game = '$game'");
	$findSender = fetch("SELECT display_name2 FROM members WHERE id = 	'$findMail[from_user]' AND game = '$game'");

	$subject = "Fwd: ". eregi_replace("Fwd: ", "", $findMail[subject]);
	$message = unformat(unsmilies(strip_tags("$findMail2[message]", "<b><i><u>")));
	$showmessage = "Orginal Message By: $findSender[display_name]\n\n$message";
}

print "<CENTER><FORM ACTION=\"$base_url/mail_send.pro.php?type=$type&id=$id\" METHOD=POST>";

if ($getInfo[premium] == "1")
{

$remember = fetch("SELECT background,text FROM remember_colors WHERE userid = '$userid'");
$rememberBG  = $remember[background];
$rememberTXT = $remember[text];
$checked[$rememberBG] = " SELECTED";
$checked2[$rememberTXT] = " SELECTED";

ECHO <<<PREM

<CENTER><TABLE BGCOLOR="#99CCFF" CELLSPACING=0 CELLPADDING=0 WIDTH=300>
   <TR>
      <TD HEIGHT=25>
         <P><B>Text Color:&nbsp;&nbsp;&nbsp;</B></P>
      </TD>
      <TD HEIGHT=25>
         <P><SELECT NAME=text_color>
        	<OPTION value="#000000">Black
        	<OPTION value="#FFFFFF">White
            <OPTION value="#990000">Dark Red
			<OPTION value="#FF0000">Red
			<OPTION value="#FF9999">Light Red
			<OPTION value="#FF3300">Orange Red
			<OPTION value="#FFCC99">Light Orange
			<OPTION value="#FFCC00">Orange
			<OPTION value="#FFFF33">Yellow
			<OPTION value="#006600">Green
			<OPTION value="#00FF00">Light Green
			<OPTION value="#009999">Green Blue
			<OPTION value="#00FFFF">Light Blue
			<OPTION value="#0066FF">Blue
			<OPTION value="#0000FF">Dark Blue
			<OPTION value="#9900CC">Purple
			<OPTION value="#CCCCFF">Light Purple
			<OPTION value="#FF0099">Pink
			<OPTION value="#FF99FF">Light Pink
         </SELECT></P>
      </TD>
   </TR>
   <TR BGCOLOR="#66CCFF">
      <TD HEIGHT=25>
         <P><B>Background Color:&nbsp;&nbsp;&nbsp;</B></P>
      </TD>
      <TD HEIGHT=25>
         <P><SELECT NAME=bg_color>
            <OPTION value="#FFFFFF">White
            <OPTION value="#000000">Black
            <OPTION value="#990000">Dark Red
			<OPTION value="#FF0000">Red
			<OPTION value="#FF9999">Light Red
			<OPTION value="#FF3300">Orange Red
			<OPTION value="#FFCC99">Light Orange
			<OPTION value="#FFCC00">Orange
			<OPTION value="#FFFF33">Yellow
			<OPTION value="#006600">Green
			<OPTION value="#00FF00">Light Green
			<OPTION value="#009999">Green Blue
			<OPTION value="#00FFFF">Light Blue
			<OPTION value="#0066FF">Blue
			<OPTION value="#0000FF">Dark Blue
			<OPTION value="#9900CC">Purple
			<OPTION value="#CCCCFF">Light Purple
			<OPTION value="#FF0099">Pink
			<OPTION value="#FF99FF">Light Pink
         </SELECT></P>
      </TD>
   </TR>
</TABLE>
</CENTER>

PREM;

}

ECHO <<<END

   <CENTER><TABLE BGCOLOR="#000000" CELLSPACING=0 CELLPADDING=0 WIDTH=475>
      <TR>
         <TD BGCOLOR="$topAndBottomBG">
            <CENTER><IMG SRC="omegapets/images/newdesign/send_message.gif" WIDTH=475 HEIGHT=14 ALIGN=bottom></CENTER>
         </TD>
      </TR>
   </TABLE>
    <TABLE BGCOLOR="#000000" CELLSPACING=1 CELLPADDING=0 WIDTH=475>
      <TR BGCOLOR="#FFFFFF">
         <TD WIDTH=120 HEIGHT=25>
            <P><B>&nbsp;Send To:</B></P>
         </TD>
         <TD HEIGHT=25>
            <P>&nbsp;&nbsp;<INPUT TYPE=text NAME="send_to" VALUE="$send_to" SIZE=16 MAXLENGTH=20></P>
         </TD>
      </TR>
      <TR BGCOLOR="$reallyLight">
         <TD WIDTH=120 HEIGHT=25>
            <P><B>&nbsp;Subject:</B></P>
         </TD>
         <TD HEIGHT=25>
            <P>&nbsp;&nbsp;<INPUT TYPE=text NAME=subject VALUE="$subject" SIZE=35></P>
         </TD>
      </TR>
      <TR BGCOLOR="#FFFFFF">
         <TD VALIGN=top WIDTH=120>
            <P><B>&nbsp;Message:</B></P>

            <p>&nbsp;<INPUT TYPE=submit NAME=Submit VALUE="Send Message!"></p>
         </TD>
         <TD VALIGN=top>
            <P><TABLE CELLSPACING=8 CELLPADDING=0>
               <TR>
                  <TD>
                     <P><TEXTAREA NAME=message ROWS=17 COLS=40 WRAP=virtual>$showmessage</TEXTAREA></P>

                     <P><INPUT TYPE=submit NAME=Submit VALUE="Send Private Message!!"></P>
                  </TD>
               </TR>
            </TABLE>
            </P>
         </TD>
      </TR>
   </TABLE>
   </CENTER>
</FORM></CENTER>

END;

print "$closeHTML";
?>